﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace HostpitalManage.GUI
{
    public partial class AddEmployee : Form
    {
        public AddEmployee()
        {
            InitializeComponent();
        }

        public void addNewEmployee() {
            String id = txtID.Text;
            String name = txtFullname.Text;
            String password = txtPass.Text;
            String user = TxtUserName.Text;
            String address = txtAddress.Text;
            int phone = Convert.ToInt32(txtPhonenumber.Text);
            DateTime birthday = dateTimePicker1.Value;
            int gender = 0;
            if (rdBoy.Checked)
            {
                gender = 1;
            }
            if (rdGirl.Checked)
            {
                gender = 0;
            }
            String email = txtMail.Text;
            String job = txtJob.Text;
            DAO.Connection connection = new DAO.Connection();
            connection.AddEmployee(id, user, password, name, address, phone, birthday, gender, job);
        }

        private void btSave_Click(object sender, EventArgs e)
        {
            addNewEmployee();
        }

        private void TxtUserName_TextChanged(object sender, EventArgs e)
        {

        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }

        private void AddEmployee_Load(object sender, EventArgs e)
        {

        }
    }
}
